﻿
namespace _3_NovaAdmin.Domain.Entities;

[Table("GroupMember")]
public class GroupMember : CompositeEntity<Guid>
{
    public GroupMember(Guid userId, Guid groupId)
    {
        this.UserId = userId;
        this.GroupId = groupId;
        this.JoinTime = DateTime.Now;
    }

    [CompositeKey]
    public Guid GroupId { get; set; }

    [CompositeKey]
    public Guid UserId { get; set; }

    public DateTime? JoinTime { get; set; }

    public override object[] GetKeys() => new object[] { GroupId, UserId };
}
